import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";

// 引入vant
import Vant from "vant";
// 配置响应式
import "vant/lib/index.css";
import "amfe-flexible";
// 引入router
import router from "./router";
// 引入vuex
import store from "./store";
// 配置axios
import axios from "axios";
// axios.defaults.baseURL = "http://localhost:8080/mob";
axios.defaults.baseURL = "http://47.108.70.211:8080/mob";
axios.interceptors.request.use((config) => {
  // 给请求头添加token字符串
  config.headers.token = window.localStorage.getItem("token");
  return config;
});
// axios.defaults.headers.common["Content-Type"] = "application/json";

const app = createApp(App);

app.config.globalProperties.$http = axios;
app.use(Vant).use(router).use(store).mount("#app");
